package com.solution.admin.product.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.solution.admin.product.dao.ProductImageDao;
import com.solution.admin.product.entity.ProductImageEntity;
import com.solution.common.dao.impl.BaseDaoImpl;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;

/**
 * 商品图片信息DAO实现
 * @author xu_cc
 * @date 2017-08-31 20:42:43
 */
@Repository
public class ProductImageDaoImpl extends BaseDaoImpl<ProductImageEntity> implements ProductImageDao {

	/**
	 * 保存商品图片信息信息
	 * @param ebProductImageEntity
	 * @return
	 * @author xu_cc
	 * @date 2017-08-31 20:42:43
	 */
	@Override
	public long saveProductImage(ProductImageEntity ebProductImageEntity) {
		return super.insert(ebProductImageEntity);
	}

	/**
	 * 删除商品图片信息
	 * @param ebProductImageId
	 * @return
	 * @author xu_cc
	 * @date 2017-08-31 20:42:43
	 */
	public int deleteByProductId(Map<String, Object> param) {
		return getSessionTemplate().delete(getStatement("deleteByProductId"), param);
	}
	
	/**
	 * 根据条件查询商品图片信息
	 * @param param
	 * @return
	 * @author xu_cc
	 * @date 2017-08-31 20:42:43
	 */
	@Override
	public List<ProductImageEntity> listProductImage( Map<String, Object> param) {
		return super.listBy(param);
	}
}
